﻿using DevComponents.DotNetBar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Kimd.Communication
{
    public partial class FormCommunication2 : Office2007Form
    {
        private ICommunicationShow _comm;
        public FormCommunication2(ICommunicationShow comm)
        {
            InitializeComponent();
            this.EnableGlass = false;
            this._comm = comm;
        }

        private void FormCommunication2_Load(object sender, EventArgs e)
        {
            this.PropertyGrid_Config.SelectedObject = this._comm.GetConfig();
        }

        private void btn_Confirm_Click(object sender, EventArgs e)
        {
            _comm.SetConfig(this.PropertyGrid_Config.SelectedObject);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
